package cn.changeforyou.analyzer.combine.orm.compare.compareResultProcessor.cmdParamters;

import cn.changeforyou.cmd.generator.CmdGeneratorParameter;
import cn.changeforyou.utils.string.StringUtils;
import com.beust.jcommander.Parameter;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;

/**
 * @author zhyu
 * @date 2021/2/19 13:28
 */
@Data
@Slf4j
public class InsertParameters implements CmdGeneratorParameter {

    @Parameter(names = {"-a", "all"}, description = "全部")
    private boolean all;

    @Parameter(names = {"-i", "insert"}, description = "需要添加的字段名, 多个字段用英文逗号分隔")
    private String insertNames;

    @Parameter(names = {"-h", "-help"}, description = "帮助文档")
    private boolean help;
    
    @Override
    public boolean isHelp() {
        return help;
    }

    @Override
    public void isHelp(boolean isHelp) {
        this.help = isHelp;
    }

    @Override
    public boolean check() {
        return all ?true: StringUtils.isEmpty(insertNames);
    }

    @Override
    public String getSign() {
        return "insertParameters";
    }
}
